package cn.com.dcsgo.springcloudstudy.order.service;

import cn.com.dcsgo.springcloudstudy.commons.pojo.CommonResult;
import cn.com.dcsgo.springcloudstudy.commons.pojo.Payment;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author Dcsgo
 * @since 2024-08-03
 */
@ComponentScan
@FeignClient(value = "mcroservice-payment")//使用Feign
public interface PaymentService {
    //调用生产者微服务名称为mcroservice-payment下边的接口
    @GetMapping("/payment/get/{id}")
    public CommonResult<Payment> queryById(@PathVariable("id") Long id);

    //调用模拟超时的接口
    @GetMapping("/payment/feign/timeout")
    public String paymentFeignTimeout() throws InterruptedException;
}
